cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need help navigating or using the PTC Community? Contact the community team. X

How to update the state definitions rgb value using js services?

AP_9587236
17-Peridot

How to update the state definitions rgb value using js services?

How to update the state definitions rgb value using js services?

ACCEPTED SOLUTION

Accepted Solutions

try to use below code..

let params = {
	name: 'testStyle' /* STYLEDEFINITIONNAME */,
	content: { "content" : 
                  {   "params": "",
                       "image":"",
                       "backgroundColor":"#d49d13",
                       "textSize":"normal",
                       "lineStyle":"dotted",
                       "displayString":"Series 15",
                       "fontEmphasisUnderline":false,
                       "fontEmphasisItalic":false,
                       "lineThickness":1,
                       "lineColor":"#ffac20",
                       "foregroundColor":"#ffdc84",
                       "fontEmphasisBold":false,
                       "secondaryBackgroundColor":"#ffb22f"              
                  }
                 } /* JSON */
};
// no return
Resources["EntityServices"].UpdateStyleDefinition(params);

Also refer... https://community.ptc.com/t5/ThingWorx-Developers/Style-definition-using-scripts/td-p/606413

 

View solution in original post

3 REPLIES 3

User will select colour name from list widget, then a service should triggered to update the corresponding rgb colour of selected colour name in the state definition. How to do this ?

slangley
23-Emerald II
(To:AP_9587236)

Hi @AP_9587236.

 

Can you explain your use case?  Are you trying to modify the state definition from a service in a mashup or API call?

 

Regards.

 

--Sharon

try to use below code..

let params = {
	name: 'testStyle' /* STYLEDEFINITIONNAME */,
	content: { "content" : 
                  {   "params": "",
                       "image":"",
                       "backgroundColor":"#d49d13",
                       "textSize":"normal",
                       "lineStyle":"dotted",
                       "displayString":"Series 15",
                       "fontEmphasisUnderline":false,
                       "fontEmphasisItalic":false,
                       "lineThickness":1,
                       "lineColor":"#ffac20",
                       "foregroundColor":"#ffdc84",
                       "fontEmphasisBold":false,
                       "secondaryBackgroundColor":"#ffb22f"              
                  }
                 } /* JSON */
};
// no return
Resources["EntityServices"].UpdateStyleDefinition(params);

Also refer... https://community.ptc.com/t5/ThingWorx-Developers/Style-definition-using-scripts/td-p/606413

 

Announcements


Top Tags