Jump to content

xalusd

Members
  • Content count

    9
  • Joined

  • Last visited

Community Reputation

0 Neutral

About xalusd

  • Rank
    Newbie
  1. Hi there ! We are trying to add the call back field in the request status change form, wich is not complicated and seemed to work. But apprently the call_back_flag value stays to "0" when the field is populated wich is not the case for other detail_xxxx forms. Here's our code: <input type="hidden" name="SET.call_back_flag" value="$args.call_back_flag" id="SET.call_back_flag"> var cbDateCheck = 0; if ( _dtl.edit) cbDateCheck = 1; if ( "$args.call_back_date_INT_DATE" != "" || ! _dtl.edit ) { <PDM_MACRO name=dtlDate hdr="Call Back Date/Time" attr=call_back_date> } else { detailDateDropdown("Call Back Date/Time", "call_back_date", 1, 20, "$args.REQUIRED_call_back_date", "SET.call_back_flag", 3600, msgtext("In_one_hour"), // In one hour 7200, msgtext("In_two_hours"), // In two hours 10800, msgtext("In_three_hours"), // In threes hours 86400, msgtext("In_one_day"), // In one day 172800, msgtext("In_two_days"), // In two days 604800, msgtext("In_one_week"), // In one week 1296000, msgtext("In_two_weeks")); // In two weeks } request_status_change.htmpl SDr12.6.2 Any idea ?
  2. Hi, Indeed works better if I don't use PDM_IF and by doing the test with document.main_form.elements["SET.group"].value thanks to you both !
  3. Hi, I'm trying to set constraints on groups when crating a ticket. I wrote a piece of code that returns "true" when the ticket's group match one of the user's group. when I want to save the ticket I use a preSaveTrigger() function that tests the result of my checkGroup function. CODE function checkGroup() { <PDM_LIST PREFIX=list WHERE="member = U'$cst.id'" FACTORY=grpmem> // $list.group // $args.group <PDM_IF "$list.group" == "$args.group"> return true; </PDM_IF> </PDM_LIST> } and the preSaveTrigger: CODE<PDM_IF "$prop.form_name_3" == "edit"> function preSaveTrigger() { if (checkGroup() == true) return true; else alert (checkGroup()); alert("Please select your own group when creating a ticket and assign it first to yourself. "); return false; } </PDM_IF> It appears the my function does not return anything when I call the preSaveTrigger. moreover, it works perferctly if I re-edit the page and if values are set. It seems that it takes the states of the fields when the page is loaded, not submitted... Can you help ? Thanks in advance. R12.6
  4. Yes it works perfectly ! thanks a lot !
  5. Hi ! So I was working a bit on this question and now my code seems to be almost right but somehow I'm missing something. In order to make the comparison I have to populate 2 arrays using the PDM_LIST function. one in detail_in.htmpl (detail_cr and detail_pr as well) $args to get the log_agent group: CODEvar zargLogAgentGroup = new Array(); <PDM_LIST PREFIX=list WHERE="member=U'$args.log_agent'" FACTORY=grpmem> // $list.group (++zargLogAgentGroup); </PDM_LIST> And one is ahdtop_site.htmpl for the $cst object current user's logged in group: ahdtop_site.htnpl: CODEvar zcstGroup = new Array(); <PDM_LIST PREFIX=list WHERE="member=U'$cst.id'" FACTORY=grpmem> // $list.group (++zcstGroup); </PDM_LIST> then I'm doing the comparaison in detail_form.js file: It compares both arrays and return false if there's a match. else it returns true. CODEfunction isInGroup(Group_reported,Group_agent) { for (i=0;i<Group_agent.length; i++){ for (j=0;j<Group_reported.length;j++){ if (Group_agent == Group_reported[j]) return false; } } return true; } I call the function on a test to nable or not the edit button: CODE if ((propFormName == "detail_cr.htmpl" || propFormName == "detail_in.htmpl" || propFormName == "detail_pr.htmpl") && (isInGroup(zargLogAgentGroup,zargLogAgentGroup))) ImgBtnCreate("btn001", "Edit[d]", "detailEdit()", false); else ImgBtnCreate("btn001", "Edit[d]", "detailEdit()", true); Unfortunately it doesn't work even if I put the same arrays (as in the code), wich must return the false. The triky thing is that if I manualy create an array and fix some UUID in them it works perfectly. So I checked the zargLogAgentGroup value in the detail_in.htmpl source and I can see my group's UUIDs; CODE // 4D26E623B68CAD4EA03AFEFBEC6040C2 (++zargLogAgentGroup); // 7F6B5B8C84B0FD479DB21C4F4C8E083C (++zargLogAgentGroup); There is surely something that I miss but can't see what....
  6. Hi ! I'm trying to disable the edit button if a contact is not a member of the log_agent group. so the code needs to be modified in those htmpl and js files: detail_form.js ahdtop_site.htmpl detail_in.htmpl detail_cr.htmpl detail_pr.htmpl It works perfectly when the attribute refers to an SREL (ex on cnt object: dep.name or org.name) The thing is that I'd like to test if the loged user is a member of the log_agent group. So it means that I need to use the group_list attribute. However group_list refers to the BREL grpmem.member and I have no idea on how to get values from there. any idea ? Thank you in advance.
  7. Hi ! I'm trying to disable the edit button if a contact is not a member of the log_agent group. so the code needs to be modified in those htmpl and js files: detail_form.js ahdtop_site.htmpl detail_in.htmpl detail_cr.htmpl detail_pr.htmpl It works perfectly when the attribute refers to an SREL (ex on cnt object: dep.name or org.name) The thing is that I'd like to test if the loged user is a member of the log_agent group. So it means that I need to use the group_list attribute. However group_list refers to the BREL grpmem.member and I have no idea on how to get values from there. any idea ? Thank you in advance.
  8. Thank you for your replies I did modify the macro code, but unfortunately it doesn't work. The problem is that we already have some constraints on the data partition wich can't be applied if we say " the user can only closed the tickets created by its group" and "the user can only modify the tickets assigned to its group" something like this group.group_list.member IN (@root.id) AND status.code!='CL' (Pre-update) log_agent.group_list.member IN (@root.id) AND status.code !='CL' so a transition status condition would be the alternative but if we can't call another object atribute.... what to do ?
  9. Hi ! I'm trying to prevent user to close a ticket based on specific access_type. Here is how I proceded: I added a macro with a condition to check that in the object 'cnt' that attribute access_type is not equal to a certain value. As the access type is not an default attribute I created it. When I specify the data value in the atomic condition , sdm can find the access types. everything's fine from here. so the macro code looks like this : if (( is_null(access_type) || access_type != 400003 )) set_return_data(TRUE); else set_return_data(FALSE); The problem appear when I ' m testing the status transition. here is the details from the log file: spelsrvr 6664 ERROR pcexec.c 6091 Spell interp failed at Z_Check_acces_type:3:: get_attr on access_type failed: AHD03066:Unknown name access_type spelsrvr 6664 ERROR macro.spl 502 AHD03066:Unknown name spelsrvr 6664 ERROR macro.spl 502 access_type If i check with the command bop_cfg -a cnt | find "acces_type" I have : access_type SREL -> acctyp.id DISPLAY_NAME "Access Type" UI_INFO "+ AUDITLOG()" So it seems to exist... I can't see what's the problem. Can you help ?
×