Quantcast
Channel: Discussion Forum > Connect Data Services
Viewing all articles
Browse latest Browse all 2504

Accessing and Setting Custom Field values in Custom Process

$
0
0

Topic by Shreyas Pandhari

Content

Hi,

I am trying to access and set the custom field value in apply() as well as TestHarness() methods but process designer throws an error. I even tried with the way given in Oracle document but still no luck. 

1. I tried with simple $object->CustomFields->c->field_name = 'xyz';

2. I am getting no clear  understanding from the Snippet (below) in document 

http://documentation.custhelp.com/euf/assets/devdocs/february2014/Connect_PHP/Default.htm.

Do we need to write metadata code for each custom field if I have n number of CFs? What is ocs_pid here?

  1. try{
  2. $inc=newRNCPHP\Incident;
  3. $md=$inc::getMetadata();
  4. $cf_type_name=$md->CustomFields->type_name;
  5. $md2=$cf_type_name::getMetadata();
  6. $inc->CustomFields->c=new$md2->c->type_name;
  7.  
  8. // must know the name 'ocs_pid' and
  9. // the data type that goes into it
  10. $inc->CustomFields->c->ocs_pid="the field";
  11.  
  12. // setting required fields for incident
  13. $cont=RNCPHP\Contact::fetch(123495);
  14. $inc->PrimaryContact=$cont;
  15. $inc->save();
  16. }
  17.  
  18. catch(Exception$err){
  19. echo $err->getMessage();
  20. }

Any help to sort out this issue would be appreciated.

 

Thanks,

Shreyas

Version

Feb14

Viewing all articles
Browse latest Browse all 2504

Trending Articles