SendCustomNotification - URL String

Hi,

I have the below code to create a custom notification. It works wonderfully, but I want to make the m-files URL a hyperlink in the notification that it sends out. I triedn using html <a href="url">Text<a/> but it tells me that it doesnt support this object or property. Does anyone know how to accomplish this?

Option Explicit

dim i, h, j, k
dim CompletedUsers(10), Users(10)
dim found : found = false




for i = 1 to vault.ObjectPropertyOperations.getproperty(objver, 45).value.getValueasLookups.count 

	CompletedUsers(i) = vault.ObjectPropertyOperations.getproperty(objver, 45).value.getValueasLookups.item(i).item

next 

for h = 1 to vault.ObjectPropertyOperations.getproperty(objver, 44).value.getValueasLookups.count 

	Users(h) = vault.ObjectPropertyOperations.getproperty(objver, 44).value.getValueasLookups.item(h).item

	
	
next



dim userOrUserGroups : set userOrUserGroups = CreateObject("MFilesAPI.UserOrUserGroupIDs")
dim userOrUserGroup : set userOrUserGroup = CreateObject("MFilesAPI.UserorUserGroupId")
dim extStrings : set ExtStrings = CreateObject("MFilesAPI.Strings")

for j = 1 to Ubound(Users)


	for k = 1 to ubound(CompletedUsers)

		If CompletedUsers(k) = Users(j) then

			found = true

		end if 

	next

	If found = false then
		
		userorUserGroup.UserOrGroupType = 1
		userorusergroup.userorgroupid = Users(j)
		userorusergroups.add j,userorusergroup
		
	else
		


	end if

found = false

next 



if Weekday(Date) = 2 or Weekday(Date) = 3 or Weekday(Date) = 4 or Weekday(Date) = 5 or Weekday(Date) = 6 then
	Vault.NotificationOperations.SendCustomNotification userOrUserGroups, false, extStrings, true, Vault.ObjectPropertyOperations.GetProperty(objver, 0).value &  " is past due", "Please complete this assignment ASAP. " &"<br />" &"<br />" & vault.objectoperations.getmfilesurlforobject(objver.objid, objver.version, true) & "<br />" & "<br/>" &" - Administration"


else
	
	

end if



' Set the workflow state to Past Due Assignment
Dim iInProgressState : iInProgressState = 10430 ' Workflow State ID, check from Workflow States value list
Dim oPropVal: Set oPropVal = CreateObject("MFilesAPI.PropertyValue")
oPropVal.PropertyDef = 39 ' Workflow states build-in property
oPropVal.TypedValue.SetValue MFDatatypeLookup, iInProgressState
Vault.ObjectPropertyOperations.SetProperty ObjVer, oPropVal

Parents
  • Hello,

    This is how I built the urls in a vbscript of mine:

    mfilesurl = Vault.ObjectOperations.GetMFilesURLForObject(oobjidassignment,0,false,MFilesURLTypeView)
    .HTMLBody = "Someone requested something: " & NameofObject & " for : " & NameofCustomer & ".<br><br> 
    Access the task from here: " & _
    "<a href="""& mfilesurl&""">Desktop</a>" &_
    "<a href=""https://mfiles.domain.com/Default.aspx?#" & Replace(Replace(vault.GetGUID(),"{",""),"}","") & "/object/" & Replace(Replace(objVersiondataObjGUID,"{",""),"}","") &"/latest"">Web </a>" &_
    "<a href=""https://openurl.m-files.com/2.0/OpenMFilesUrl.html?MFilesURL=m-files://show/" & Replace(Replace(vault.GetGUID(),"{",""),"}","") & "/" & ObjVer.Type & "-" & ObjVer.ID & "?object=" & Replace(Replace(objVersiondataObjGUID,"{",""),"}","") &"/latest"">Mobile</a>"

Reply
  • Hello,

    This is how I built the urls in a vbscript of mine:

    mfilesurl = Vault.ObjectOperations.GetMFilesURLForObject(oobjidassignment,0,false,MFilesURLTypeView)
    .HTMLBody = "Someone requested something: " & NameofObject & " for : " & NameofCustomer & ".<br><br> 
    Access the task from here: " & _
    "<a href="""& mfilesurl&""">Desktop</a>" &_
    "<a href=""https://mfiles.domain.com/Default.aspx?#" & Replace(Replace(vault.GetGUID(),"{",""),"}","") & "/object/" & Replace(Replace(objVersiondataObjGUID,"{",""),"}","") &"/latest"">Web </a>" &_
    "<a href=""https://openurl.m-files.com/2.0/OpenMFilesUrl.html?MFilesURL=m-files://show/" & Replace(Replace(vault.GetGUID(),"{",""),"}","") & "/" & ObjVer.Type & "-" & ObjVer.ID & "?object=" & Replace(Replace(objVersiondataObjGUID,"{",""),"}","") &"/latest"">Mobile</a>"

Children
No Data