疯了

文章 评论 浏览 29

疯了 2025-02-20 20:19:58

您可能会使用模式在包括下划线的右侧主张9-21个字符,然后将前两个部分与单个下划线匹配:

^(?=\\w{9,21}_[A-Z0-9])[A-Z]+_[A-Z0-9]+

dixpantion

  • ^ String的开始
  • 代码>(?= 正面lookahead,断言当前位置的权利是什么
    • \\ w {9,21} _ [a-Z0-9] 匹配9-21个字char,然后是下划线和char az或digit
  • )关闭lookahead
  • [AZ]+匹配1+ chars az
  • _ 匹配第一个下划线
  • [A-Z0-9]+匹配1+ chars az或a digit

regex demo | r demo

x = c('XY_ABCD101_12_ACE', 'XZ_ACC122_100_BAN', 'XT_AAEEE100_12345_ABC', 'XKY_BBAAUUU124_100')
regmatches(x, regexpr("^(?=\\w{9,21}_[A-Z0-9])[A-Z]+_[A-Z0-9]+", x, perl = TRUE))

输出

[1] "XY_ABCD101"     "XZ_ACC122"      "XT_AAEEE100"    "XKY_BBAAUUU124"

You might use a pattern to assert 9-21 chars to the right including the underscore, then the match the first 2 parts with the single underscore:

^(?=\\w{9,21}_[A-Z0-9])[A-Z]+_[A-Z0-9]+

Explanation

  • ^ Start of string
  • (?= Positive lookahead, assert what is to the right of the current location is
    • \\w{9,21}_[A-Z0-9] Match 9-21 word chars followed by an underscore and a char A-Z or a digit
  • ) Close the lookahead
  • [A-Z]+ Match 1+ chars A-Z
  • _ Match the first underscore
  • [A-Z0-9]+ Match 1+ chars A-Z or a digit

Regex demo | R demo

x = c('XY_ABCD101_12_ACE', 'XZ_ACC122_100_BAN', 'XT_AAEEE100_12345_ABC', 'XKY_BBAAUUU124_100')
regmatches(x, regexpr("^(?=\\w{9,21}_[A-Z0-9])[A-Z]+_[A-Z0-9]+", x, perl = TRUE))

Output

[1] "XY_ABCD101"     "XZ_ACC122"      "XT_AAEEE100"    "XKY_BBAAUUU124"

用特定格式提取部分字符串

疯了 2025-02-20 13:06:25

Web蓝牙扫描是Chrome中的一个实验功能。请注意此警告:

注意:扫描仍在开发中。您必须将Chrome 79+与Chrome使用:// flags/#enable-pershimentim-web-platform-features启用标志。

https://googlechrome.githrome.githrome.github.io/samples/samples/web-bluetoothoth/scan/scan。 html

如果您启用了此功能,则应该能够扫描使用服务UUID 0XFEAA,然后解析服务数据:

event.serviceData.forEach((valueDataView, key) => {
  logDataView('Service', key, valueDataView);
});

您应该使用Eddystone-url的特殊压缩算法看到这些服务数据字节中编码的URL。您将需要编写JavaScript来解码此压缩,如下所述:

htttps:https:// github.com/google/eddystone/tree/master/eddystone-url

Web Bluetooth scanning is an experimental feature in Chrome. Note this warning:

Note: Scanning is still under development. You must be using Chrome 79+ with the chrome://flags/#enable-experimental-web-platform-features flag enabled.

https://googlechrome.github.io/samples/web-bluetooth/scan.html

If you enable that, you should be able to scan for devices with service UUID 0xFEAA, then parse out the service data:

event.serviceData.forEach((valueDataView, key) => {
  logDataView('Service', key, valueDataView);
});

You should see the URL encoded in those service data bytes using a special compression algorithm of Eddystone-URL. You will need to write JavaScript to decode this compression as described here:

https://github.com/google/eddystone/tree/master/eddystone-url

如何通过Web蓝牙API获取Eddystone URL信标信息?

疯了 2025-02-19 23:45:48

您可以首先迭代 dict ,然后在所有值上使用for-loop,并重复日期:

import json
res = [{'data':k, 'currancy':a, 'value':b} for k,v in dct.items() for a,b in v]
json_data = {"filtered_data": res}
print(json.dumps(json_data))

输出:

{"filtered_data": [{"data": "2020-04-20", "currancy": "EUR", "value": 34.02}, {"data": "2020-04-20", "currancy": "USD", "value": 30.18}, {"data": "2020-04-20", "currancy": "AWG", "value": 24.44}, {"data": "2020-04-20", "currancy": "GPB", "value": 20.68}, {"data": "2020-04-25", "currancy": "EUR", "value": 16.88}, {"data": "2020-04-25", "currancy": "USD", "value": 15.06}, {"data": "2020-04-25", "currancy": "AWG", "value": 12.17}, {"data": "2020-04-25", "currancy": "GPB", "value": 10.4}, {"data": "2020-04-27", "currancy": "EUR", "value": 17.14}, {"data": "2020-04-27", "currancy": "GPB", "value": 10.28}, {"data": "2020-04-27", "currancy": "USD", "value": 7.58}, {"data": "2020-04-27", "currancy": "AWG", "value": 5.06}, {"data": "2020-04-27", "currancy": "CZK", "value": 2.44}]}

You can first iterate over dict then use for-loop on all value with repeated date:

import json
res = [{'data':k, 'currancy':a, 'value':b} for k,v in dct.items() for a,b in v]
json_data = {"filtered_data": res}
print(json.dumps(json_data))

Output:

{"filtered_data": [{"data": "2020-04-20", "currancy": "EUR", "value": 34.02}, {"data": "2020-04-20", "currancy": "USD", "value": 30.18}, {"data": "2020-04-20", "currancy": "AWG", "value": 24.44}, {"data": "2020-04-20", "currancy": "GPB", "value": 20.68}, {"data": "2020-04-25", "currancy": "EUR", "value": 16.88}, {"data": "2020-04-25", "currancy": "USD", "value": 15.06}, {"data": "2020-04-25", "currancy": "AWG", "value": 12.17}, {"data": "2020-04-25", "currancy": "GPB", "value": 10.4}, {"data": "2020-04-27", "currancy": "EUR", "value": 17.14}, {"data": "2020-04-27", "currancy": "GPB", "value": 10.28}, {"data": "2020-04-27", "currancy": "USD", "value": 7.58}, {"data": "2020-04-27", "currancy": "AWG", "value": 5.06}, {"data": "2020-04-27", "currancy": "CZK", "value": 2.44}]}

Python:将数据转换为适当的字典格式

疯了 2025-02-18 20:33:57

允许作为分支结构:

更改:

a)将插入插入选择

b)每个语句必须以;

execute immediate $
declare
  new_price number(12,2);
  new_purpose varchar;
  c1 cursor for select price, purpose from invoice_original;
begin
  for record in c1 do
        new_price := record.price;
        new_purpose := record.purpose;
           
        CASE  
        WHEN :new_purpose ILIKE'%Business%' THEN
          INSERT INTO invoice_final(study_number, price, price_type) 
          SELECT '1', :new_price, 'Dollars';
        ELSE 
          INSERT INTO invoice_final(study_number, price, price_type) 
          SELECT '2', :new_price, 'Dollars';
        END CASE;
        
  end for;
end;
$;

免责声明结束:当无法将代码重写为基于设定的方法。

INSERT INTO invoce_final(study_number, price, price_type)
SELECT CASE WHEN purpose ILIKE'%Business%' THEN 1 ELSE 2 END,
       price,
       'Dollars'
FROM invoice_orginal;

The CASE statement is allowed as branching construct:

Changes:

a) using INSERT INTO SELECT

b) each statement must end with ;

execute immediate $
declare
  new_price number(12,2);
  new_purpose varchar;
  c1 cursor for select price, purpose from invoice_original;
begin
  for record in c1 do
        new_price := record.price;
        new_purpose := record.purpose;
           
        CASE  
        WHEN :new_purpose ILIKE'%Business%' THEN
          INSERT INTO invoice_final(study_number, price, price_type) 
          SELECT '1', :new_price, 'Dollars';
        ELSE 
          INSERT INTO invoice_final(study_number, price, price_type) 
          SELECT '2', :new_price, 'Dollars';
        END CASE;
        
  end for;
end;
$;

Disclaimer: Using cursor loop and loop in general should be used when there is no way of rewriting the code to set-based approach.

INSERT INTO invoce_final(study_number, price, price_type)
SELECT CASE WHEN purpose ILIKE'%Business%' THEN 1 ELSE 2 END,
       price,
       'Dollars'
FROM invoice_orginal;

使用情况何时将带有值()子句-Snowflake SQL(经典Web界面)的新表插入新表中

疯了 2025-02-18 20:14:42

您在详细信息模板中引用的上下文对象有些混合。

您使用的是通用 lidetview ,默认情况下将特定对象添加到上下文中为 object 。但是您正在尝试将其称为对象和帖子。因此,请尝试将其保留到对象;

            {% extends 'base.html' %} {% block content %}
            <!-- {% load static %} -->

            <div class="container">
                <div class="row">
                <div class="col-md-8 card mb-4  mt-3 left  top">
                <div class="card-body">
                    <h1>{% block title %} {{ object.title }} {% endblock title %}</h1>
                    <p class=" text-muted">{{ object.author }} | {{ object.created_on }}</p>

                    <!-- /carrot-cake/static/placeholder_cake -->

                    <img class="card-img-top" src="{{ object.image }}" alt="Card image cap">
                    <p class="card-text "><pre class="recipe">{{ object.content|safe }}</pre></p>
                </div>
                </div>

                {% block sidebar %} {% include 'sidebar.html' %} {% endblock sidebar %}
                </div>
            </div>

            {% endblock content %}

您还使用URL示例提到了静态路径。如果您将某些内容上传到您创建的模型中的字段,那将不会使用静态路径。那将使用您的媒体设置。

静态文件包括CSS/JavaScript/Images等,但是媒体文件是用户使用的内容。

而且我刚刚发现了您对 safe 过滤器的使用。使用过滤器时,您不需要那里的空间。

The context objects you're referring to in the detail template are a bit mixed up.

You're using the generic DetailView, which by default adds the specific object to the context as object. But you're trying to refer to it as both object and post. So try to keep it to object;

            {% extends 'base.html' %} {% block content %}
            <!-- {% load static %} -->

            <div class="container">
                <div class="row">
                <div class="col-md-8 card mb-4  mt-3 left  top">
                <div class="card-body">
                    <h1>{% block title %} {{ object.title }} {% endblock title %}</h1>
                    <p class=" text-muted">{{ object.author }} | {{ object.created_on }}</p>

                    <!-- /carrot-cake/static/placeholder_cake -->

                    <img class="card-img-top" src="{{ object.image }}" alt="Card image cap">
                    <p class="card-text "><pre class="recipe">{{ object.content|safe }}</pre></p>
                </div>
                </div>

                {% block sidebar %} {% include 'sidebar.html' %} {% endblock sidebar %}
                </div>
            </div>

            {% endblock content %}

You've also referred to the static path with your URL examples. If you're uploading something to a field in a model you've created, that won't use your static path. That will use your media settings instead.

Static files include css/javascript/images etc, but media files are user-uploaded content.

And I've just spotted your use of the safe filter. You don't need a space in there when you're using filters.

urls.py and views.py slug删除

疯了 2025-02-18 04:46:10

您确实选择了一个困难的话题。在火花中,没有Python UDF可以完成95%以上的事情。您应该始终尝试找到一种不创建UDF的方法。

我尝试过您的UDF,我遇到了同样的错误,我真的不知道为什么。我认为数据类型有一些东西,当您将Spark Array传递到一个期望Numpy数据类型的函数中。我真的无法说出更多...

对于欧几里得距离,可以在火花中计算出来。不过,这并不容易。

from pyspark.sql import functions as F
df = spark.createDataFrame(
    [([0, 1, 0], [1.5, 2., 1.]),
     ([5, 7, 6], [10., 7., 7.])],
    ['features', 'center'])

distance = F.aggregate(
    F.transform(
        F.arrays_zip('features', 'center'),
        lambda x: (x['features'] - x['center'])**2
    ),
    F.lit(0.0),
    lambda acc, x: acc + x,
    lambda x: x**.5
)
df = df.withColumn('distance', distance)

df.show()
# +---------+----------------+------------------+
# | features|          center|          distance|
# +---------+----------------+------------------+
# |[0, 1, 0]| [1.5, 2.0, 1.0]|2.0615528128088303|
# |[5, 7, 6]|[10.0, 7.0, 7.0]|5.0990195135927845|
# +---------+----------------+------------------+

You have truly chosen a difficult topic. In Spark, 95%+ of things can be done without python UDFs. You should always try to find a way not to create a UDF.

I've attempted your UDF, I got the same error, and I cannot really tell, why. I think there's something with data types, as you pass Spark array into a function which expects numpy data types. I really can't tell much more...

For Euclidian distance, it's possible to calculate it in Spark. Not an easy one, though.

from pyspark.sql import functions as F
df = spark.createDataFrame(
    [([0, 1, 0], [1.5, 2., 1.]),
     ([5, 7, 6], [10., 7., 7.])],
    ['features', 'center'])

distance = F.aggregate(
    F.transform(
        F.arrays_zip('features', 'center'),
        lambda x: (x['features'] - x['center'])**2
    ),
    F.lit(0.0),
    lambda acc, x: acc + x,
    lambda x: x**.5
)
df = df.withColumn('distance', distance)

df.show()
# +---------+----------------+------------------+
# | features|          center|          distance|
# +---------+----------------+------------------+
# |[0, 1, 0]| [1.5, 2.0, 1.0]|2.0615528128088303|
# |[5, 7, 6]|[10.0, 7.0, 7.0]|5.0990195135927845|
# +---------+----------------+------------------+

在Pyspark中的两个其他列的函数中添加列

疯了 2025-02-18 04:32:03

Hashmap 无法维护订单,因此您无法对其进行排序。

您可以将地图内容转储到列表中,并使用自定义比较器对其进行排序。但是您缺少一些东西 - 构造数据的方式是错误的, state cities state 是两个信息彼此密切相关。使用地图将它们结合在一起是滥用收藏品,这使您的代码僵化且无法实现。

使用对象的力量,

您的代码不会自动成为面向对象的因素,因为您使用的是面向对象的语言。

正确的方法是定义状态 city 作为类,并维护状态>状态对象的列表,而不是处理嵌套 map

class State {
    private String name;
    private List<City> cities = new ArrayList<>();
    
    public State(String name) {
        this.name = name;
    }
    
    public void addCity(City city) {
        cities.add(city);
    }
    
    public boolean removeCity(City city) {
        return cities.remove(city);
    }
    
    public List<City> getCities() {
        return cities;
    }
    
    @Override
    public String toString() {
        return "State:" + name + "\n" +
            cities.stream()
                .map(City::toString)
                .collect(Collectors.joining("\n"))
            + "\n";
    }
}

class City {
    private String name;
    private int count;
    
    public City(String name, int count) {
        this.name = name;
        this.count = count;
    }
    
    @Override
    public String toString() {
        return "City:" + name + " Count:" + count;
    }
}

这就是您可以在客户端代码中使用此类的方式:

public static void main(String[] args) {
    List<State> states = new ArrayList<>();
    State texas = new State("Texas");
    texas.addCity(new City("Austin", 1));
    
    State hawaii = new State("Hawaii");
    hawaii.addCity(new City("Honolulu", 1));
    hawaii.addCity(new City("Kihei", 1));
    hawaii.addCity(new City("Maui", 1));
    
    State california = new State("California");
    california.addCity(new City("Newport Beach", 1));
    
    Collections.addAll(states, texas, hawaii, california);
    
    states.sort(Comparator.<State>comparingInt(state -> state.getCities().size()).reversed());
    
    for (State state: states) {
        System.out.println(state);
    }
}

输出:

State:Hawaii
City:Honolulu Count:1
City:Kihei Count:1
City:Maui Count:1

State:Texas
City:Austin Count:1

State:California
City:Newport Beach Count:1

HashMap is not capable of maintaining the order, therefore you can't sort it.

You can dump the map contents into a list and sort it using a custom comparator. But there's something that you're missing - the way you're structuring the data is wrong, state and cities that belong to that state are two pieces of information are closely related to each other. Using a map to combine them together is an abuse of collections, it makes your code rigid and unmaintainable.

Use the power of Objects

Your code doesn't become object-oriented automatically because of the fact that you're using an object-oriented language.

The correct approach would be to define State and City as classes and maintain a list of State objects instead of dealing with a nested map.

class State {
    private String name;
    private List<City> cities = new ArrayList<>();
    
    public State(String name) {
        this.name = name;
    }
    
    public void addCity(City city) {
        cities.add(city);
    }
    
    public boolean removeCity(City city) {
        return cities.remove(city);
    }
    
    public List<City> getCities() {
        return cities;
    }
    
    @Override
    public String toString() {
        return "State:" + name + "\n" +
            cities.stream()
                .map(City::toString)
                .collect(Collectors.joining("\n"))
            + "\n";
    }
}

class City {
    private String name;
    private int count;
    
    public City(String name, int count) {
        this.name = name;
        this.count = count;
    }
    
    @Override
    public String toString() {
        return "City:" + name + " Count:" + count;
    }
}

That's how you can use this classes in the client code:

public static void main(String[] args) {
    List<State> states = new ArrayList<>();
    State texas = new State("Texas");
    texas.addCity(new City("Austin", 1));
    
    State hawaii = new State("Hawaii");
    hawaii.addCity(new City("Honolulu", 1));
    hawaii.addCity(new City("Kihei", 1));
    hawaii.addCity(new City("Maui", 1));
    
    State california = new State("California");
    california.addCity(new City("Newport Beach", 1));
    
    Collections.addAll(states, texas, hawaii, california);
    
    states.sort(Comparator.<State>comparingInt(state -> state.getCities().size()).reversed());
    
    for (State state: states) {
        System.out.println(state);
    }
}

Output:

State:Hawaii
City:Honolulu Count:1
City:Kihei Count:1
City:Maui Count:1

State:Texas
City:Austin Count:1

State:California
City:Newport Beach Count:1

根据嵌套在给定的hashmap内部的每个hashmap的大小,按顺序打印hashmap的内容

疯了 2025-02-17 17:01:18

尝试以下操作:

data.loc[(data.type=='Movie') & (data.genre=='Action') & (data.description.str.contains('taxi')}]

Try this:

data.loc[(data.type=='Movie') & (data.genre=='Action') & (data.description.str.contains('taxi')}]

如何在类似&#x27; String&#x27;的条件下应用在pandas中的data [&#x27; linter&#x27;]中

疯了 2025-02-15 21:31:38

也许我有点晚了,但是如果您还没有解决它:您在clbfile变量中获得响应(exec_http的最后一个参数-FunProg exec_http(HeaderCod,HeaderCod,headerval,headerval,data,reshead,resbody))。

以下是解析resbody clbfile的一些选择:

  1. 直接以4GL解析内容。
  2. nodejs(自定义模块)中的模块
  3. 可执行

Maybe I am a little late, but in case you did not solve it yet: You get the response in a clbfile variable (last parameter of EXEC_HTTP - Funprog EXEC_HTTP(HEADERCOD, HEADERVAL, DATA, RESHEAD, RESBODY)).

Here are a few options to parse the RESBODY clbfile:

  1. Parse the content directly in 4gl.
  2. Module in nodeJS (custom module)
  3. Executable called by "System" instruction

Sage X3第三方Web服务XML

疯了 2025-02-15 17:33:29

content-type 放入postrophes 'content-type'中,因此它不会给出语法错误,然后您在body-tag part files上使用json.stringify()问题。

const metadataResponse = await fetch(userDetailsByIdUrl, {
                        method: 'PATCH',

                        headers: {
                            Authorization: `Bearer ${accessToken}`,
                            'Content-Type': 'application/json',
                        },
                        body: JSON.stringify({ "user_metadata" : { "addresses": {"work_address": "100 Industrial Way"} }}),
                    })

PS:将我从JavaScript Pls中拯救出来

Putting Content-Type inside Apostrophes 'Content-Type' so it doesn't give a Syntax Error and then you using JSON.Stringify() at the Body-Tag part fixes the problem.

const metadataResponse = await fetch(userDetailsByIdUrl, {
                        method: 'PATCH',

                        headers: {
                            Authorization: `Bearer ${accessToken}`,
                            'Content-Type': 'application/json',
                        },
                        body: JSON.stringify({ "user_metadata" : { "addresses": {"work_address": "100 Industrial Way"} }}),
                    })

PS: save me from javascript pls

如何求解“预期类型对象,但找到字符串”在REST API电话中? (ReactJS,JavaScript)

疯了 2025-02-15 14:04:12

尝试此代码。

 bool isExpand = false;
      @override
      Widget build(BuildContext context) {
        return Scaffold(
          body: ExpansionTile(
            onExpansionChanged: (bool isExapnd) {
              setState(() {
                isExpand = isExapnd;
              });
            },
            textColor: Colors.black,
            title: Text(
              "Title",
              style: TextStyle(
                  fontWeight: isExpand ? FontWeight.bold : FontWeight.normal),
            ),
            expandedAlignment: Alignment.centerLeft,
            expandedCrossAxisAlignment: CrossAxisAlignment.start,
            children: [
              Table(
                border: TableBorder.all(color: Colors.black),
                defaultVerticalAlignment: TableCellVerticalAlignment.top,
                children: [
                  TableRow(children: [
                    Text("This is"),
                    Text("a sample."),
                  ]),
                ],
              ),
            ],
          ),
        );
      }

Try with this code.

 bool isExpand = false;
      @override
      Widget build(BuildContext context) {
        return Scaffold(
          body: ExpansionTile(
            onExpansionChanged: (bool isExapnd) {
              setState(() {
                isExpand = isExapnd;
              });
            },
            textColor: Colors.black,
            title: Text(
              "Title",
              style: TextStyle(
                  fontWeight: isExpand ? FontWeight.bold : FontWeight.normal),
            ),
            expandedAlignment: Alignment.centerLeft,
            expandedCrossAxisAlignment: CrossAxisAlignment.start,
            children: [
              Table(
                border: TableBorder.all(color: Colors.black),
                defaultVerticalAlignment: TableCellVerticalAlignment.top,
                children: [
                  TableRow(children: [
                    Text("This is"),
                    Text("a sample."),
                  ]),
                ],
              ),
            ],
          ),
        );
      }

如何更改flutter中扩展的文本样式?

疯了 2025-02-15 08:39:54

我有这个问题。我解决了:

  • Open Finder
  • CMD+Shift+G
  • Input 〜/.config
  • 如果 GCLOUD 目录不存在,请创建它。
  • 右键单击 gcloud 目录&gt;获取信息&gt;共享&amp;权限&GT;将“读取”给所有级别。

我不知道这是否安全,但是它允许安装完成。

I had this issue. I solved by:

  • Open Finder
  • CMD+SHIFT+G
  • Input ~/.config
  • If gcloud directory does not exist, create it.
  • Right Click gcloud directory > Get Info > Sharing & Permissions > Give "Read & Write" to all levels.

I do not know if this is safe, but it allowed installation to complete.

请验证您有权写信给父目录

疯了 2025-02-14 17:17:35

您可以在不在后端进行身份验证时实现用例。实际上,您可以部署API云未经验证,但使用 Ingress设置设置为内部仅

然后,在反向代理云运行中,您必须添加a

该设计仅接受反向代理的身份验证和授权请求,并使API后端仅通过反向代理(或VPC中的其他内部资源)到达。


该设计将起作用,但有几个权衡:

  • 您无法定义谁可以访问您的API后端。它是“内部”:您项目中的任何内部资源都可以访问它。 您也可以访问后端,在这里没有不同的授权级别(至少使用Google Cloud Services。
  • 此外,如果您可以访问反向代理, 高于负载平衡器
  • 该设计仅适用于重定向

You can achieve your use case without authentication on your backend. In fact, you can deploy the API Cloud Run unauthenticated but with ingress set to internal only

Then, on your reverse proxy Cloud Run, you have to add a Serverless VPC connector and set the egress to all

That design accepts only authenticated and authorized request on the reverse proxy and makes the API backend only reachable by the reverse proxy (or other internal resource in your VPC).


This design will work but there is several tradeoff:

  • You can't define who has access to your API backend. It's "internal": any internal resource in your project can access it. In addition, if you have access to the reverse proxy you also have access to the backend, not different level of authorization possible here (at least with Google Cloud services. You can add homemade authorization check in your code)
  • The Serverless VPC connector cost is higher than a Load Balancer
  • The design is complex for only a redirect

如何在Google Cloud中配置NGINX反向代理,以指向其他Google Cloud Run应用程序

疯了 2025-02-14 15:03:06

将记录ID从FSL传递到SF应用程序: -

step 1: create aura application:
<aura:application access="GLOBAL" extends="ltng:outApp">
    <aura:dependency resource="YOUR LWC NAME"/>
</aura:application>    

step 2: create vf page:-

<apex:page docType="html-5.0">
  <apex:includeLightning />
  <div id="lightning"/>
    <script>
    //Get the parameter named msg
    var msg = "{!$CurrentPage.parameters.msg}";
    // If msg is null, find it parsing the page URL
    if (msg== null || msg=="") {
        var urlEnc=window.location.href;
        var splitted1 = urlEnc.split('=');
       var splitted=splitted1[2].split('&');
        msg=splitted[0];
        
        
    }
    //Create the Lighting Component inside the VisualForcePage
    $Lightning.use("c:YOUR AURA APP NAME", function() {
       
      $Lightning.createComponent("c:YOUR LWC NAME",{"recordId" : msg},"lightning",
          function(cmp) {
              
          });      
        });
    </script>
    </apex:page>

step 3: create tab for this vf page 

step 4: enable checkbox in vf page settings 

step 5: inside field service mobile settings create an app

 extension choose type as lightning app and provide launch value as "tabname?msg={!Id}" 

step 6:now just use @api recordId to fetch the record id of current page

PASS THE RECORD ID FROM FSL TO SF APPLICATION:-

step 1: create aura application:
<aura:application access="GLOBAL" extends="ltng:outApp">
    <aura:dependency resource="YOUR LWC NAME"/>
</aura:application>    

step 2: create vf page:-

<apex:page docType="html-5.0">
  <apex:includeLightning />
  <div id="lightning"/>
    <script>
    //Get the parameter named msg
    var msg = "{!$CurrentPage.parameters.msg}";
    // If msg is null, find it parsing the page URL
    if (msg== null || msg=="") {
        var urlEnc=window.location.href;
        var splitted1 = urlEnc.split('=');
       var splitted=splitted1[2].split('&');
        msg=splitted[0];
        
        
    }
    //Create the Lighting Component inside the VisualForcePage
    $Lightning.use("c:YOUR AURA APP NAME", function() {
       
      $Lightning.createComponent("c:YOUR LWC NAME",{"recordId" : msg},"lightning",
          function(cmp) {
              
          });      
        });
    </script>
    </apex:page>

step 3: create tab for this vf page 

step 4: enable checkbox in vf page settings 

step 5: inside field service mobile settings create an app

 extension choose type as lightning app and provide launch value as "tabname?msg={!Id}" 

step 6:now just use @api recordId to fetch the record id of current page

如何将RecordID从FSL移动应用程序传递到Salesforce移动应用程序?

疯了 2025-02-14 11:33:27

只需在HTML文件的Head标签中添加此代码(在这种情况下为 car.html

<link rel="icon" type="image/png" href="favicon.png"/>

将解决问题。

Just add this code in the head tag of html file (car.html in this case)

<link rel="icon" type="image/png" href="favicon.png"/>

The problem will be solved.

动态路线返回favicon.ico而不是烧瓶中的变量

更多

推荐作者

櫻之舞

文章 0 评论 0

弥枳

文章 0 评论 0

m2429

文章 0 评论 0

野却迷人

文章 0 评论 0

我怀念的。

文章 0 评论 0

更多

友情链接

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文